Include <ftw.h> and use nftw() and all the symbols defined in <ftw.h>
authorEmmanuele Bassi <ebassi@gnome.org>
Sun, 13 May 2007 21:21:39 +0000 (21:21 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Sun, 13 May 2007 21:21:39 +0000 (21:21 +0000)
2007-05-13  Emmanuele Bassi  <ebassi@gnome.org>

* gtk/gtksearchenginesimple.c: Include <ftw.h> and use nftw() and
all the symbols defined in <ftw.h> conditionally.

svn path=/trunk/; revision=17836

ChangeLog
gtk/gtksearchenginesimple.c

index 20adee37acd9db144a52fe6e59843b979d254a67..a4007ffe583ad329dd5e540a30045266f8c4f59b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-13  Emmanuele Bassi  <ebassi@gnome.org>
+
+       * gtk/gtksearchenginesimple.c: Include <ftw.h> and use nftw() and
+       all the symbols defined in <ftw.h> conditionally.
+
 2007-05-13  Cody Russell  <bratsche@gnome.org>
 
        * gdk/win32/gdkevents-win32.c: Only do the configure event context
index cfc6da850eb504cab7a9e9c69f5142f5279cd319..26768488ee198a03afa849152972ee4e05a027fd 100644 (file)
 #include "xdgmime/xdgmime.h"
 
 #include <string.h>
+
+#ifdef HAVE_FTW_H
 #include <ftw.h>
+#endif
+
 #include <glib/gstrfuncs.h>
 
 #define BATCH_SIZE 500
@@ -184,6 +188,7 @@ send_batch (SearchThreadData *data)
 
 static GStaticPrivate search_thread_data = G_STATIC_PRIVATE_INIT;
 
+#ifdef HAVE_FTW_H
 static int
 search_visit_func (const char        *fpath,
                   const struct stat *sb,
@@ -256,16 +261,18 @@ search_visit_func (const char        *fpath,
   
   if (data->n_processed_files > BATCH_SIZE)
     send_batch (data);
-       
+
   if (is_hidden)
     return FTW_SKIP_SUBTREE;
   else
     return FTW_CONTINUE;
 }
+#endif /* HAVE_FTW_H */
 
 static gpointer 
 search_thread_func (gpointer user_data)
 {
+#ifdef HAVE_FTW_H
   SearchThreadData *data;
   
   data = user_data;
@@ -277,6 +284,7 @@ search_thread_func (gpointer user_data)
   send_batch (data);
   
   g_idle_add (search_thread_done_idle, data);
+#endif
   
   return NULL;
 }
@@ -366,9 +374,9 @@ _gtk_search_engine_simple_init (GtkSearchEngineSimple *engine)
 GtkSearchEngine *
 _gtk_search_engine_simple_new (void)
 {
-  GtkSearchEngine *engine;
-  
-  engine = g_object_new (GTK_TYPE_SEARCH_ENGINE_SIMPLE, NULL);
-  
-  return engine;
+#ifdef HAVE_FTW_H
+  return g_object_new (GTK_TYPE_SEARCH_ENGINE_SIMPLE, NULL);
+#else
+  return NULL;
+#endif
 }